package com.hopu.service.Impl;

import com.hopu.mapper.EmpMapper;
import com.hopu.pojo.Emp;
import com.hopu.service.EmpService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpMapper empMapper;

    @Override
    public Emp login(String ename,String epsw) {
        return empMapper.login(ename,epsw);
    }

    @Override
    public Emp findByEname(@Param("ename") String ename) {
        return empMapper.findByEname(ename);
    }

    @Override
    public List<Emp> findAllEmp(int eflag) {
        return empMapper.findAllEmp(eflag);
    }

    @Override
    public int addEmp(int jid, int pid, String ename, String epsw, String erealname, String etel, String eaddress, String eremark, int eflag) {
        return empMapper.addEmp(jid,pid,ename,epsw,erealname,etel,eaddress,eremark,eflag);
    }

    @Override
    public int delEmp(int eid) {
        return empMapper.delEmp(eid);
    }

    @Override
    public int huiFuEmp(int eid) {
        return empMapper.huiFuEmp(eid);
    }

    @Override
    public Emp findEmpById(String eid) {
        return empMapper.findEmpById(eid);
    }

    @Override
    public int uppEmp(int eid, int jid, int pid, String ename, String epsw, String erealname, String etel, String eaddress, String eremark,int eflag) {
        return  empMapper.uppEmp(eid,jid,pid,ename,epsw,erealname,etel,eaddress,eremark,eflag);
    }

    @Override
    public int uppPwd(int eid, String epsw) {
        return empMapper.uppPwd(eid,epsw);
    }
}
